#!/bin/bash
# --------------------------------------------------
#Author:  LJ
#Email:   admin@attacker.club
#Last Modified: 2019-04-17 11:21:28
# --------------------------------------------------


#yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el7.noarch.rpm 
#centos7 python2
#yum install https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el6.noarch.rpm
#centos6 python
#yum install https://repo.saltstack.com/py3/redhat/salt-py3-repo-latest-2.el7.noarch.rpm 
#centos7 python3



yum remove salt-minion -y &&rm /etc/salt/pki/minion/ -rf # 清理key

yum install salt-minion -y 
[ -f "/etc/salt/minion" ] && cat > /etc/salt/minion <<EOF
master: salt.ops.net #ip,dns

id: $HOSTNAME
tcp_keepalive: True
tcp_keepalive_idle: 300
tcp_keepalive_cnt: -1
tcp_keepalive_intvl: -1
EOF

chkconfig salt-minion on &&  service  salt-minion restart
#systemctl enable salt-minion &&  systemctl restart  salt-minion 
